<template>
  <div class='table-pagination' >
        1111111
    </div>

</template>

<style lang="scss">
// @import "./Breadcrumb.scss"
</style>
<script>
import { mapMutations, mapState } from 'vuex'
import api from '@/api'
import axios from '@/utils/request'
    export default {
  props: {
    url: String,
    params: Object
  },
  data() {
    return {
      sourceData: [],
      sourceTotal: 1,
      start: 1,
      limit: 10,
      loading: true
    }
  },
  created() {
    this.getTableData()
  },
  methods: {
    async getTableData() {
      let params = Object.assign({}, this.params, { start: this.start, limit: this.limit })
      for (let i in params) {
        if (!params[i]) delete params[i]
      }
      this.loading = true;
      // axios.get(this.url,params).the((res)=>{
      //     console.log(res);  
      // })
      let data = []
      // let { data } = await request.get(this.url, params)
      this.loading = false;
      this.sourceData = data.data && data.data.list || [];
      this.sourceTotal = data.data && data.data.totalCount || 0;
    },
    handleSizeChange: function(size) {
      this.limit = size;
      this.start = 1;
      this.getTableData();
    },
    handleIndexChange: function(index) {
      this.start = index;
      this.getTableData();
    }
  }
}

</script>
